<?php

class Project_Model extends CI_Model{

	var $ci_project = '';
	var $nm_project  = '';
    var $ds_project = '';
    var $dt_start    = '';
    var $dt_end   = '';

    function __construct()
    {
        // Call the Model constructor
        parent::__construct();        
    }

    function save($entry){
    	$this->ci_project = $entry['ci_project'];
        $this->nm_project = $entry['nm_project'];
    	$this->ds_project = $entry['ds_project'];
    	$this->dt_start = $entry['dt_start'];
    	$this->dt_end = $entry['dt_end'];
    	
    	if($this->ci_project == ""){
    		$this->db->insert('projects', $this);
    	}else{
    		echo "teste";
			$this->db->where('ci_project', $this->ci_project);
			$this->db->update('projects', $this); 
    	}
    		
    }
}

?>